<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>图书列表</title>
    <link href="css/layout.css" rel="stylesheet" type="text/css"/>
    <link href="css/list.css" rel="stylesheet" type="text/css"/>

</head>
<body>
<table class="tablelist">

    <thead>
    <tr>
        <th>编号</th>
        <th>封面</th>
        <th>图书名称</th>
        <th>单价（元）</th>
        <th>数量(件）</th>
        <th>小计（元）</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${cart}" var="cart" varStatus="s">
        <tr>
            <td>${s.count}</td>
            <td class="imgtd"><img src="${cart.image}" height="110" width="78"/></td>
            <td>${cart.name}</td>
            <td>${cart.price}元</td>
            <td>
                <form action="CountServlet" method="post">
                    <input type="hidden" name="cartid" value="${cart.id}"/>
                     <button type="submit" name="button" value="-"style="width: 30px">-</button>
                    <input type=text style="width: 50px" name=amount value=${cart.number}>
                    <button type="submit" name="button" value="+" style="width: 30px">+</button>
                </form>
            </td>
            <td>${cart.totalprice}元</td>
            <td><a href="RemoveServlet?id=${cart.id}" type="button" class="tablelink"><img src="images/remove.jpg" width="20" height="14"/>移出购物车</a></td>
        </tr>
    </c:forEach>
    </tbody>
    <thead>
    <tr>
        <th></th>
        <th></th>
        <th></th>
        <th></th>
        <th>共选${sumnumber}件</th>
        <th>总价${sumprice}元</th>
        <th><a href="PayServlet" type="button" class="tablelink"><img src="images/jiesuan.jpg" width="20" height="20"/>结算</a></th>
    </tr>
    </thead>
</table>
</body>
</html>

